package com.kitty.mybatis.mybatisv1.executor.statement;

import com.kitty.mybatis.mybatisv1.executor.Executor;
import com.kitty.mybatis.mybatisv1.mapping.KittyBoundSql;
import com.kitty.mybatis.mybatisv1.mapping.KittyMappedStatement;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

/**
 * @Description
 * @Author SHEN
 * @Date 2020/11/5
 */
public class KityPreparedStatementHandler extends KittyBaseStatementHandler {


    public KityPreparedStatementHandler(Executor executor, KittyMappedStatement mappedStatement, Object parameterObject, KittyBoundSql boundSql) {
        super(executor, mappedStatement, parameterObject, boundSql);
    }

    @Override
    protected Statement instantiateStatement(Connection connection) throws SQLException {
        return null;
    }

    @Override
    public void parameterize(Statement statement) throws SQLException {

    }

    @Override
    public <E> List<E> query(Statement statement) throws SQLException {
        PreparedStatement ps = (PreparedStatement) statement;
        ps.execute();
        return resultSetHandler.<E> handleResultSets(ps);
    }

    @Override
    public KittyBoundSql getBoundSql() {
        return null;
    }
}
